<?php
	// no direct access
	defined('_JEXEC') or die;
?>
<?php if(count($slideshow) > 0): ?>
<div class="pt_slideshow<?php echo ' '.$moduleclass_sfx; ?>">
					
<script type="text/javascript" charset="utf-8">
	jQuery(document).ready(function($) {
		$('.flexslider').flexslider({
			namespace: 			"<?php echo $fle_namespace; ?>",
			selector:			"<?php echo $fle_selector; ?>",
			animation:			"<?php echo $fle_animation; ?>",
			easing:				"<?php echo $fle_easing; ?>",
			direction:			"<?php echo $fle_direction; ?>",
			animationLoop:		<?php echo $fle_animationLoop; ?>,
			smoothHeight:		<?php echo $fle_smoothHeight; ?>,
			startAt:			<?php echo $fle_startAt; ?>,
			slideshow:			<?php echo $fle_slideshow; ?>,
			slideshowSpeed:		<?php echo $fle_slideshowSpeed; ?>,
			animationSpeed:		<?php echo $fle_animationSpeed; ?>,
			initDelay:			<?php echo $fle_initDelay; ?>,
			randomize:			<?php echo $fle_randomize; ?>,
			
			// Usability features
			pauseOnAction:		<?php echo $fle_pauseOnAction; ?>,
			pauseOnHover:		<?php echo $fle_pauseOnHover; ?>,
			useCSS:				<?php echo $fle_useCSS; ?>,
			touch:				<?php echo $fle_touch; ?>,
			video:				<?php echo $fle_video; ?>,
			
			// Primary Controls
			controlNav:			<?php echo $fle_controlNav; ?>,
			directionNav:		<?php echo $fle_directionNav; ?>,
			prevText:			"<?php echo $fle_prevText; ?>",
			nextText:			"<?php echo $fle_nextText; ?>",
			
			// Secondary Navigation
			keyboard:			<?php echo $fle_keyboard; ?>,
			multipleKeyboard:	<?php echo $fle_multipleKeyboard; ?>,
			mousewheel:			<?php echo $fle_mousewheel; ?>,
			pausePlay:			<?php echo $fle_pausePlay; ?>,
			pauseText:			'<?php echo $fle_pauseText; ?>',
			playText:			'<?php echo $fle_playText; ?>',
			
			// Special properties
			controlsContainer:	"<?php echo $fle_controlsContainer; ?>",
			manualControls:		"<?php echo $fle_manualControls; ?>",
			sync:				"<?php echo $fle_sync; ?>",
			asNavFor:			"<?php echo $fle_asNavFor; ?>",
			
			// Carousel Options
			itemWidth:			<?php echo $fle_itemWidth; ?>,
			itemMargin:			<?php echo $fle_itemMargin; ?>,
			minItems:			<?php echo $fle_minItems; ?>,
			maxItems:			<?php echo $fle_maxItems; ?>,
			move:				<?php echo $fle_move; ?>,
	
			// Callback API
			start: function(slider){		//Callback: function(slider) - Fires when the slider loads the first slide
			  $('body').removeClass('loading');
			},
			before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation
			after: function(){},            //Callback: function(slider) - Fires after each slider animation completes
			end: function(){},              //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
			added: function(){},            //{NEW} Callback: function(slider) - Fires after a slide is added
			removed: function(){}           //{NEW} Callback: function(slider) - Fires after a slide is removed
		});
	});
</script>
<div class="<?php echo $moduleclass_sfx; ?>">
	<div class="flexslider">
		<ul class="slides">
		<?php foreach($slideshow as $item): ?>
			<li>
				<img src="<?php echo $item->url_; ?>" alt="<?php echo $item->title_; ?>"/>
				<p class="flex-caption"><?php echo $item->description_; ?></p>
			</li>
		<?php endforeach; ?>
		</ul>
	</div>
</div>

</div>
<?php endif; ?>